/**
 * Backend.java
 * Copyright (C) 2011 Yuanyan<yuanyan.cao@gmail.com>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * For information on how to redistribute this software under
 * the terms of a license other than GNU General Public License
 * contact yuanyan.cao@gmail.com
 */
package edu.rabbit.kernel.db;


import edu.rabbit.kernel.IBackend;
import edu.rabbit.kernel.SafetyLevel;
import edu.rabbit.kernel.TransactionState;
import edu.rabbit.kernel.btree.IBtree;
import edu.rabbit.schema.ISchema;

/**
 * @author Yuanyan<yanyan.cao@gmail.com>
 * 
 *
 */
public class Backend implements IBackend {
    
    private IBtree btree;
    private String name;
    private SafetyLevel safetyLevel;
    private ISchema schema;
    private TransactionState transactionState;

    /**
     * 
     */
    public Backend(String name, IBtree btree, ISchema schema) {
        this.name = name;
        this.btree = btree;
        this.schema = schema;
    }
    
    /* (non-Javadoc)
     * @see org.tmatesoft.rabbit.core.IBackend#getBtree()
     */
    public IBtree getBtree() {
        return btree;
    }

    /* (non-Javadoc)
     * @see org.tmatesoft.rabbit.core.IBackend#getName()
     */
    public String getName() {
        return name;
    }

    /* (non-Javadoc)
     * @see org.tmatesoft.rabbit.core.IBackend#getSafetyLevel()
     */
    public SafetyLevel getSafetyLevel() {
        return safetyLevel;
    }

    /**
     * @param safetyLevel the safetyLevel to set
     */
    public void setSafetyLevel(SafetyLevel safetyLevel) {
        this.safetyLevel = safetyLevel;
    }
    
    /* (non-Javadoc)
     * @see org.tmatesoft.rabbit.core.IBackend#getSchema()
     */
    public ISchema getSchema() {
        return schema;
    }

    /* (non-Javadoc)
     * @see org.tmatesoft.rabbit.core.IBackend#getTransactionState()
     */
    public TransactionState getTransactionState() {
        return transactionState;
    }

    /**
     * @param transactionState the transactionState to set
     */
    public void setTransactionState(TransactionState transactionState) {
        this.transactionState = transactionState;
    }
    
}
